﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

namespace WebApplication1
{
    public class Dbhepr
    {
        private static readonly string connSql = "server=.;database=CMS;uid=sa;pwd=123456";
        public static  DataTable dataTable(string sql)
        {
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sql, connSql);
            DataTable data = new DataTable();
            sqlDataAdapter.Fill(data);
            return data;
        }
        public static int OrUpDataOrDelete(string sql)
        {
            SqlConnection sqlConnection = new SqlConnection(connSql);
            SqlCommand sqlCommand = new SqlCommand(sql,sqlConnection);
            sqlConnection.Open();
            var bt = sqlCommand.ExecuteNonQuery();
            sqlConnection.Close();
            return bt;
        }
    }
}